package com.itnoob.adapter;

import cn.hutool.extra.spring.SpringUtil;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * @author zhoujun
 * @date 2025/3/17 21:31
 */
@Component("WECHATPAY")
public class PayForWechatAdapter implements PayAdapter{

    @Override
    public boolean support(String adapter) {
        return SpringUtil.getBean(adapter) instanceof PayForWechatAdapter;
    }

    @Override
    public String pay(String id, BigDecimal amount, Object adapter) {
        //调用微信支付的api
        //业务逻辑

        return "调用微信支付成功支付" + amount + "元";
    }
}
